package itcz.example.pattern.create_action.factory.factory_method;

/**
 * @ClassName: CoffeeStore
 * @Author: ITCZ
 * @Date: 2025-04-26
 * @Description: 咖啡
 */
public class CoffeeStore {

    private CoffeeFactory factory;

    public void setFactory(CoffeeFactory factory) {
        this.factory = factory;
    }

    public Coffee orderCoffee() {
        Coffee coffee = factory.createCoffee();
        coffee.addMilk();
        coffee.addSugar();
        return coffee;
    }
}
